date_timezone_get
Alias for DateTime::getTimezone - Returns the time zone relative to the given date and time
The date_timezone_get()
function returns the time zone of the given DateTime object.
Returns the time zone of the given DateTime object:
<?php $date = date_create ( null , timezone_open ( "Europe/Paris" ) ) ; $tz = date_timezone_get ( $date ) ; echo timezone_name_get ( $tz ) ; ?>
Try it yourself
date_timezone_get ( object ) ;
parameter | describe |
---|---|
object | Required. Specifies the DateTime object returned by date_create() . |